package org.jeecg.modules.demo.homepage.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.baseordercommodity.entity.BaseOrderCommodity;
import org.jeecg.modules.demo.homepage.mapper.HomePageMapper;
import org.jeecg.modules.demo.homepage.service.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@Slf4j
public class HomePageServiceImpl implements HomePageService {

    @Autowired
    private HomePageMapper homePageMapper;

    @Override
    public List<Map<String, Object>> listOrderSale(String storeId, String start, String end) {
        return homePageMapper.listOrderSale(storeId, start, end);
    }

    @Override
    public List<Map<String, Object>> listServeCommission(String storeId, String start, String end) {
        return homePageMapper.listServeCommission(storeId, start, end);
    }

    @Override
    public List<Map<String, Object>> listOrderCount(String storeId, String start, String end) {
        return homePageMapper.listOrderCount(storeId, start, end);
    }

    @Override
    public List<Map<String, Object>> listMemberCount(String storeId, String start, String end) {
        return homePageMapper.listMemberCount(storeId, start, end);
    }

    @Override
    public List<Map<String, Object>> listStockMemberCount(String storeId, String start, String end) {
        return homePageMapper.listStockMemberCount(storeId, start, end);
    }

    @Override
    public List<Map<String, Object>> listStockCount(String storeId, String start, String end) {
        return homePageMapper.listStockCount(storeId, start, end);
    }

    @Override
    public List<Map<String, Object>> listBalanceCount(String storeId, String changeCode, String start, String end) {
        return homePageMapper.listBalanceCount(storeId, changeCode, start, end);
    }

    @Override
    public List<Map> listOrderProject(@Param("storeId") String storeId, @Param("name") String name, @Param("phone") String phone, @Param("projectName") String projectName, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize) {
        return homePageMapper.listOrderProject(storeId, name, phone, projectName, pageNo, pageSize);
    }

    @Override
    public int countOrderProject(@Param("storeId") String storeId, @Param("name") String name, @Param("phone") String phone, @Param("projectName") String projectName) {
        return homePageMapper.countOrderProject(storeId, name, phone, projectName);
    }

    @Override
    public List<Map> listMember(String storeId, String name, String phone, Integer pageNo, Integer pageSize) {
        return homePageMapper.listMember(storeId, name, phone, pageNo, pageSize);
    }

    @Override
    public int countMember(String storeId, String name, String phone) {
        return homePageMapper.countMember(storeId, name, phone);
    }

    @Override
    public List<BaseOrderCommodity> listOrderCommodity(@Param("storeId") String storeId, @Param("start") String start, @Param("end") String end) {
        return homePageMapper.listOrderCommodity(storeId, start, end);
    }
}
